﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
	[TestClass]
	public class UserData_61_TransportServiceType_Test
	{
		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test01_Equals()
		{
			UserData_61_TransportServiceType userData = new UserData_61_TransportServiceType(eTransportServiceType.AnalogDynamicConnection);

			{
				// completely different type - NOT equal
				object dummyObject = new object();
				Assert.IsFalse(userData.Equals(dummyObject));
			}

			{
				// different derived type
				UserData userData2Compare = new UserData_01_Priority(0x77);
				Assert.IsFalse(userData.Equals(userData2Compare));
			}
			
			{
				// same object - equal
				UserData_61_TransportServiceType userData2Compare = new UserData_61_TransportServiceType(userData.TransportServiceType);
				Assert.IsTrue(userData.Equals(userData2Compare));
			}
			
			{
				// different eTransportServiceType value - NOT equal
				eTransportServiceType transportServiceType = eTransportServiceType.ISDN_B_Channel;
				if (userData.TransportServiceType == eTransportServiceType.ISDN_B_Channel)
				{
					transportServiceType = eTransportServiceType.TCP_IP_Intranet;
				}
				UserData_61_TransportServiceType userData2Compare = new UserData_61_TransportServiceType(transportServiceType);
				Assert.IsFalse(userData.Equals(userData2Compare));
			}
		}		

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test02_GetHashCode()
		{
			UserData_61_TransportServiceType userData = new UserData_61_TransportServiceType(eTransportServiceType.RadioDataTransmission);
			int hashCode = userData.GetHashCode();			
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test03_ToString()
		{
			UserData_61_TransportServiceType userData = new UserData_61_TransportServiceType(eTransportServiceType.MobileRadioCommunication);
			string stringResult = userData.ToString();
			Assert.IsNotNull(stringResult);
		}
	}
}
